<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>主界面</title>
    <link rel="shortcut icon" type="image/png" th:href="@{../images/fav.png}">
    <script th:src="@{./bootstrap-3.3.7/js/bootstrap.js}"></script>
    <link rel="stylesheet" th:href="@{./bootstrap-3.3.7/css/bootstrap.css}" />
    <link rel="stylesheet" th:href="@{../layui/css/layui.css}" media="all">
    <link rel="stylesheet" th:href="@{../layui/css/layui.mobile.css}">
    <script th:src="@{../js/jquery-3.2.1.min.js}"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


</head>
    <ul class="layui-nav">
    <li class="layui-nav-item"><a href="/index">一分钟诊所</a>
      </li>
    <li class="layui-nav-item"><a href="/login">
        <span 登录 th:if="${session.sessionValue!=null}" th:text="欢迎+${session.sessionValue}"></span>
        <span th:unless="${session.sessionValue!=null}" >登录</span></a>
        <dl class="layui-nav-child">
            <dd><a th:href="@{/logout}">登出</a></dd>
            <dd class="layui-this"><a th:href="@{/register}">注册</a></dd>
            <dd><a th:href="@{/login}">登录</a></dd>
            <dd><a th:href="@{/view/modifyPwd}">忘记密码</a></dd>

        </dl>
    </li>
  <!--  <li class="layui-nav-item">
        <a href="javascript:;">健康检测</a>
    </li>-->
 <!--   <li class="layui-nav-item"><a href="" style="color: #f00">一键交车</a></li>-->
    </ul>
<hr style="border:solid 1px #1E9FFF">
<table align="center">
        <tr>
            <td width="22" height="93" align="center" valign="middle" bgcolor="#FFFFFF"><strong><span
                    style="color: #FF0000; "><br>
        </span></strong></td>
            <td width="371" align="center" valign="middle" bgcolor="#FFFFFF">
                <div align="left">1、请勿在此发布与本站无关的话题；<br>
                    2、严禁发布违法内容，否则后果自负；<br>
                    3、<span style="color: #FF0000; ">请大家一定把患者的<span
                            style="font-size: small; "><strong>姓别</strong></span></span><span
                            style="color: #FF0000; font-size: small; "><strong>、年龄和病情</strong></span><span
                            style="color: #FF0000; ">写清楚</span>；
                </div>
            </td>
            <td width="331" align="center" valign="middle" bgcolor="#FFFFFF">
                <div align="left"><strong><span style="color: #ff0000; ">4、对于您提出的问题，我们两个工作日内给予回复</span></strong>；<br>
                    5、每条留言内容不能超过800个字；<br>
                    6、本网上诊所隐藏了用户的电话和E-mail
                </div>
            </td>
        </tr>
        <tr>
            <td height="29" colspan="3" align="center" valign="middle" bgcolor="#DDDDDD">
                <form action="/index" method="get" name="myForm" onsubmit="return searchForm()"class="layui-form" >
                    <div class="layui-form-item" style="margin-top: 30px" align="center">
                        <div class="layui-inline">
                            <div class="layui-inline">
                                <input type="submit" id="search" class="layui-btn" lay-submit lay-filter="formDemo" value="搜索">
                                    <div class="layui-input-inline">
                                        <input class="layui-input" type="text" id="keyword" name="keyword" size="40"  placeholder="关键字" th:value="${keyword}"/>
                                    </div>
                                </div>
                            </div>
                            <div class="layui-input-inline" style="margin-left: 110px">
                                <select id="action" name="action" size="1" class="layui-form-label" >
                                    <option value="all"      th:selected="${action}=='all'">全部搜索</option>
                                    <option value="content"  th:selected="${action}=='content'">询诊留言</option>
                                    <option value="reply"    th:selected="${action}=='reply'">医生回复</option>
                                    <option value="username" th:selected="${action}=='username'">姓　　名</option>
                                </select>

                            </div></div></div>

                </form>
            </td>
        </tr>
</table>
<div align="center"id="user-list">
    <span style="color: #FF6600; ">
        <a th:href="@{${'/view/consultation'}(username=${session.sessionValue})}">
            <img src="../images/ly.jpg"  border="0" alt="网上诊所询诊"></a> </span></div>
<table width="720" height="100" align="center" cellpadding="10" cellspacing="0" bgcolor="#FFFFFF" class="table-3"
       style="TABLE-LAYOUT: fixed">
    <tr th:each="user : ${pageInfo.list}" th:object="${user}">
        <td width="7" align="center" valign="top" class="table-you"><p>&nbsp;</p></td>
        <td width="24" valign="top" style="word-wrap: break-word"><!--valign:垂直排列方式； word-wrap：属性允许长单词或 URL地址换行到下一行&ndash;&gt;-->
            <div align="center" >
                <span style="color: #FF6600; "></span>
            </div>
        </td>
        <td width="627" valign="top" >
            <hr align="center" width="100%" size="1" noshade color="f1f1f1" class="h"><!--noshade:没有阴影效果的水平线&ndash;&gt;-->
            <div align="center">网上诊所</div>
            <div align="center">
                <p align="left"><strong>姓名</strong>：[[*{patient.name}]] &nbsp;&nbsp;<strong>性别</strong>：[[*{patient.sex}]]
                    &nbsp;&nbsp;<strong>年龄</strong>：[[*{patient.age}]]</p>
                <p align="left"><strong>询诊内容：</strong>
                    [[*{consultation.content}]]
                    <br>
                    <span style="color: #FF6600; "> </span>
                </p>
            </div>
         <span style="color: #FF6600; "width="627">
            <strong>医师回复：</strong>
         </span>
            <textarea rows="10" cols="100" disabled style="resize:none;color: #FF6600;background: whitesmoke"> [[*{consultation.reply}]]</textarea>
        </td>
    </tr>
</table>
</div>
    <div align="center">
    <nav>
        <ul class="pagination">
            <li>
                <a th:if="${not isFirstPage}" th:href="@{${'/index'}(pageNum=${pageNum}-1,pageSize=${pageSize},action=${action},keyword=${keyword})}" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
                <a th:if="${isFirstPage}" href="javascript:void(0);" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </li>

            <li th:each="pageNo : ${#numbers.sequence(1, totalPages)}">
                <a th:if="${pageNum eq pageNo}" href="javascript:void(0);">
                    <span th:text="${pageNo}"></span>
                </a>

                <a th:if="${not (pageNum eq pageNo)}" th:href="@{${'/index'}(pageNum=${pageNo},pageSize=${pageSize},action=${action},keyword=${keyword})}">
                    <span th:text="${pageNo}"></span>
                </a>
            </li>

            <li>
                <a th:if="${not isLastPage}" th:href="@{${'/index'}(pageNum=${pageNum+1},pageSize=${pageSize},action=${action},keyword=${keyword})}" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
                <a th:if="${isLastPage}" href="javascript:void(0);" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </li>
        </ul>
    </nav>
</div>
</div>

<footer>
        <div style="text-align: center;margin: 0 auto;line-height: 200px" >天码行空 © 2020 ----<a href="/admin/login">管理员</a>-----<a href="/doctor/patients" >医生</a>-----</div>
</footer>

<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script th:src="@{./layui/layui.all.js}" charset="utf-8">
    layui.use('element', function(){
        var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块

        //监听导航点击
        element.on('nav(demo)', function(elem){
            //console.log(elem)
            layer.msg(elem.text());
        });
    });
    //Demo
    layui.use('form', function(){
        var form = layui.form;
        //监听提交
        form.on('submit(formDemo)', function(data){
            layer.msg(JSON.stringify(data.field));
            return false;
        });
    });
</script>
<script type="text/javascript">
    function searchForm() {
        /*      var x=document.forms["myForm"]["keyword"].value;
              var key2=$("input[name='keyword']").val();
              alert("key+key1"+key2+x);*/
        if($("#keyword").val() ==''||$("#keyword").val()==null){
            $("#keyword").focus();
            alert("请输入关键字");
            return false;
        }
    }
</script>
</body>
</html>